package com.yima.baseproj.module.sys.parent;


import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yima.baseproj.config.mybatis.handler.MybatisDateTypeHandler;
import com.yima.baseproj.module.sys.parent.model.ParentAddModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;


@Data
@TableName("yry_parent")
public class ParentEntity  implements Serializable {

  @TableId(value = "id" ,type = IdType.AUTO)
  private Integer id;

  @ApiModelProperty(value = "家长微信头像")
  private String parentVxtx;

  @ApiModelProperty(value = "家长微信账号id")
  private String parentVxid;

  @ApiModelProperty(value = "亲属关系")
  private String parentRelation;

  @TableField(fill = FieldFill.INSERT,value = "create_by")
  private String createBy;

  @TableField(fill = FieldFill.INSERT,value = "create_time",typeHandler = MybatisDateTypeHandler.class)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss",locale = "zh")
  private Date createTime;

  @TableField(fill = FieldFill.INSERT_UPDATE,value = "update_by")
  private String updateBy;

  @TableField(fill = FieldFill.INSERT_UPDATE,value = "update_time",typeHandler = MybatisDateTypeHandler.class)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss",locale = "zh")
  private Date updateTime;

  @TableField(value = "del_flag")
  @TableLogic(value = "0",delval = "1")
  private String delFlag = "0";


  public void setParentEntity(ParentAddModel parentAddModel){
    this.parentVxid = parentAddModel.getParentVxid();
    this.parentVxtx = parentAddModel.getParentVxtx();
    this.parentRelation = parentAddModel.getParentRelation();
  }

  @TableField(exist = false)
  //学生姓名
  private String studentName;

}
